# Contributor: Thomas Deutsch <thomas@tuxpeople.org>
# Maintainer: Thomas Deutsch <thomas@tuxpeople.org>
pkgname=lazygit
pkgver=0.40.2
pkgrel=2
pkgdesc="Simple terminal UI for git commands"
url="https://github.com/jesseduffield/lazygit"
arch="all"
license="MIT"
# bash: for running git commands
depends="ncurses bash"
makedepends="go"
options="!check" # FIXME: https://github.com/jesseduffield/lazygit/issues/1009
subpackages="$pkgname-doc"
source="$pkgname-$pkgver.tar.gz::https://github.com/jesseduffield/lazygit/archive/v$pkgver.tar.gz"

export GOCACHE="${GOCACHE:-"$srcdir/go-cache"}"
export GOTMPDIR="${GOTMPDIR:-"$srcdir"}"
export GOMODCACHE="${GOMODCACHE:-"$srcdir/go"}"

build() {
	go build -ldflags="-X main.version=$pkgver" -v
}

package() {
	install -Dm0755 $pkgname -t "$pkgdir"/usr/bin

	mkdir -p "$pkgdir"/usr/share/doc
	mv docs "$pkgdir"/usr/share/doc/"$pkgname"
	install -Dm0644 LICENSE -t "$pkgdir"/usr/share/licenses/"$pkgname"
}

sha512sums="
201bd09705ad48c41ed62ac061b31e62ce51a351eff5dae36a3bf5654d62fdef5d2a93e3f4ad56c0b02c70fb0e323319ed38d64c3bfef36900423983284b52c1  lazygit-0.40.2.tar.gz
"
